<?php
if ($handle = opendir('.')) {

    while (false !== ($entry = readdir($handle))) {

        if ($entry != "." && $entry != ".." && $entry != "index.php") {

            echo "<a href='".$entry."'>$entry\n</a><br>";
        }
    }

    closedir($handle);
}
?>